<div id="portfolio-con" class="content">
    <div id="portfolio-wrap">
        <table width="100%">
            <tr>
                <td>
                    <div class="left-con">
                    </div>
                </td>
                <td>
                    <div class="center-con">
                        <div class="center-separator"></div>
                        <div class="content-title">
                            <h1>Ubah Portofolio #<?php echo $id ?></h1>
                        </div>
                        <div class="content-main">
                            <div class="content-wrap">
                                <?php echo $form; ?>

                                <?php echo form_open_multipart(base_url("portfolio/ganti_cover/$id")); ?>
                                <h2 style="margin-bottom: 5px" id="ganti_cover">Cover</h2>
                                <table>
                                    <tr>
                                        <?php
                                        $gambar = $model->gambar_utama;
                                        if (empty($gambar))
                                            $gambar = 'default.gif';
                                        ?>
                                        <td><img width="120" height="150" alt="<?php echo $gambar ?>" src="<?php echo base_url() . "assets/images/portfolio/" . $gambar ?>" /></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <?php
                                            echo form_upload('gambar_utama', $model->gambar_utama, 'id="gambar_utama"');
                                            echo form_submit('ganti', 'Ganti');
                                            ?>
                                        </td>
                                    </tr>
                                </table>
                                <?php echo form_close(); ?>

                                <br/>
                                <h2 style="margin-bottom: 5px" id="portfolio_image">Screen Shoot</h2>
                                <table>
                                    <tr><th>Gambar</th><th>Prioritas</th></tr>
                                    <?php
                                    $images = $model->get_portfolio_images();
                                    foreach ($images as $image) :
                                        ?>
                                        <tr>
                                            <td style="position: relative">
                                                <img width="100" height="100" alt="<?php echo $image->url ?>" src="<?php echo base_url('assets/images/portfolio/' . $image->url) ?>" />
                                                <a style="position: absolute;top: 3px;left: 77px" title="Hapus" href="<?php echo base_url('portfolio/delete_image/' . $image->idportofolio_image) ?>"><img width="20" alt="delete" src="<?php echo base_url('assets/images/portfolio/delete.png'); ?>"/></a>
                                            </td>
                                            <td>
                                                <?php
                                                echo form_open(base_url("portfolio/update_image_priority/{$image->idportofolio_image}"));
                                                echo form_input('prioritas', $image->prioritas, 'style="width:30px"');
                                                echo form_submit('ubah', 'Ubah');
                                                echo form_close();
                                                ?>
                                            </td>
                                        </tr>
                                    <?php endforeach; ?>
                                    <tr>
                                        <td colspan="2">
                                            <?php
                                            echo form_open_multipart(base_url("portfolio/add_image/$id"));
                                            echo form_upload('url');
                                            echo form_submit('tambah', 'Tambah');
                                            echo form_close();
                                            echo "<br/><br/><br/>";
                                            ?>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="right-con">

                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>